package com.platform.system.base;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author Huangkai
 */
@Data
public class SuperEntity<T extends Model> extends Model {
    private static final long serialVersionUID = -4851055162892178225L;

    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * uid
     */
    @TableField("uid")
    private String uid;

    /**
     * 排序
     */
    @TableField("sort")
    private Integer sort;
    /**
     * 0表示不删除，1表示删除
     * */
    @TableLogic(value = "0", delval = "2")
    @TableField("is_del")
    private Integer isDel;
    /**
     * @TableField 配置需要填充的字段
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd'T'HH:mm:ss")
    @TableField("create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd'T'HH:mm:ss")
    @TableField("update_time")
    private Date updateTime;
}
